﻿using System;
using System.Web.Mvc;
using SlamCms.Tracking;
using SlamCms.Web.Mvc;

namespace SlamCms.Areas._admin.Controllers
{
	[Tracking(TrackingBehavior.NoTrack)]
	public class TrackingController : Controller
	{
		private readonly Lazy<TrackingService> trackingService;

		public TrackingController(Lazy<TrackingService> trackingService)
		{
			this.trackingService = trackingService;
		}

		public ActionResult Page(string what, string how, string contentItemId)
		{
			this.trackingService.Value.TrackPage(what, how, contentItemId);
			return Json(new { Ok = true });
		}
	}
}
